package cn.zhx.singleton.demo;

/**
 * 饿汉式
 * 类加载就会导致该单实例对象被创建
 */
public class Singleton01 {

    //私有构造方法
    private Singleton01(){}

    private static Singleton01 instance = new Singleton01();

    public static Singleton01 getInstance(){
        return instance;
    }
}
